home *** CD-ROM | disk | FTP | other *** search
/ Zoom 2 / Zoom - Release 2 (1996)(Active Software)[!].iso / programming / amos / amossible / spritesnbobs / displaybob.amos / displaybob.amosSourceCode < prev    next >
Encoding:
AMOS Source Code  |  1980-05-16  |  2.9 KB  |  52 lines

  1. '*********************BOB WHO???????????-By Mark Wickson**********************   
  2. Rem After you have loaded the Bobs in the usual way(See elsewhere for  
  3. Rem details of loading files),you have to use the "Get Bob Palette"  
  4. Rem command to make sure they are the colours you defined them.
  5. Rem next we place the Bob of our choice on screen,you can
  6. Rem have upto 64 bobs on screen. 
  7. Rem The first number after the word Bob is the Bob number,this is
  8. Rem important if you're going to have more than one Bob on screen at 
  9. Rem a time,this is so you can have several objects on screen at a time 
  10. Rem but make each one do different things-So each Bob you have on screen 
  11. Rem must have a different number-Its easiest to increase the number by 1 
  12. Rem for every new Bob.so if you were going to use Bob 1 you'd write:   
  13. Rem Bob 1, 
  14. Rem The next number is the Bobs horizontal position on the current screen,   
  15. Rem so for this current screen the number can be anything between 0 and  
  16. Rem 320-If you wanted to put it on the right hand side,you'd set it around 
  17. Rem 300,if you wanted it to be on the left hand side,you'd set it around 
  18. Rem 20,and the centre is roughly 150-But you can put it any where within 
  19. Rem these limits,lets imagine we want it in the centre,so we type: 
  20. Rem Bob 1,150, 
  21. Rem The next number is the vertical position of the Bob on the current 
  22. Rem screen,so for this current screen the number can be anything between 
  23. Rem 0 and 256-If you want it near the top,you'd set it around 10,if you
  24. Rem wanted it in the centre,110 is approximately right,and the bottom of 
  25. Rem the screen would be around 230,but as above,you're free to set it
  26. Rem anywhere within the limits of the screen.Like this:
  27. Rem Bob 1,150,110, 
  28. Rem The final number is the IMAGE number of the Bob,don't confuse this 
  29. Rem with the Bob number-This is what affects the visual aspect of the  
  30. Rem Bob-Not the Bob itself(In the Sprite/Bob bank maker,you aren't actually
  31. Rem defining the Bobs as such,but the images that ANY of them can have)  
  32. Rem If you have created 10 images in your Bob bank and want to use   
  33. Rem the first image for the first Bob,you'd write: 
  34. Rem Bob 1,150,110,1  
  35. Rem But if you wanted Bob 1 to use the fifth image in the bank,you'd write:  
  36. Rem Bob 1,150,110,5  
  37. Rem So you can use any image number that you want with any Bob-You can even  
  38. Rem have several different Bobs with the same image number.  
  39. Rem In our example we use the "Wait Vbl" command which makes AMOS wait until 
  40. Rem the screen has `drawn' itself before progressing-Because our program is so 
  41. Rem small if you took that instruction the Bob wouldn't even appear-You  
  42. Rem don't have to include this command in larger programs or ones that have  
  43. Rem commands after the "Bob" command.  
  44. Screen Open 0,320,256,16,Lowres
  45. Flash Off 
  46. Curs Off 
  47. Cls 0
  48. Load "ATTBG:JUMP.Abk"
  49. Get Bob Palette 
  50. Bob 1,150,110,1
  51. Wait Vbl 
  52. Rem "AMOS 1.3" owners should change "Get Bob palette" to "Get Sprite Palette".